<template>
    <header>
        <section>
            <!-- 阻止表单的默认提交事件 -->
            <form @submit.prevent>
                <label for="title">ToDoList</label>
                <add @add="add" />
            </form>
        </section>
    </header>
</template>
<script>
import add from './add.vue'
export default {
    components: {
        add
    },
    setup(props,context) {
        function add(value) {
            context.emit('add',value)
        }
        return {
            add
        }
    }
}
</script>